<template>
  <div>
    {{ $store.state.moduleA.name }}
    <!-- {{ $store.getters['moduleA/name'] }} -->
    {{ $store.getters.name }}
    <button @click="btn">按钮</button>
    <button @click="btn1">按钮异步</button>
  </div>
</template>

<script>
export default {
  data () {
    return {}
  },
  created () {
    this.getData()
  },
  methods: {
    getData () {},
    btn () {
      // this.$store.commit('moduleA/nameFn', '大厦')
      this.$store.commit('nameFn', '大厦')
    },
    btn1 () {
      // this.$store.dispatch('moduleA/nameFnSync', { time: 2000, data: 12 })
      this.$store.dispatch('nameFnSync', { time: 2000, data: 12 })
    }
  }
}
</script>

<style></style>
